package com.suzhe.ymall.common.utils;


import com.suzhe.ymall.common.pojo.AppLoginUser;
import com.suzhe.ymall.common.pojo.SysLoginUser;

/**
 * @author suzhe
 * @date 2019/6/8
 */
public class LoginUserUtils {

    private static ThreadLocal<SysLoginUser> sysLoginuserLocal = new ThreadLocal<SysLoginUser>();

    private static ThreadLocal<AppLoginUser> appLoginUserLocal = new ThreadLocal<AppLoginUser>();


    public static SysLoginUser getSysLoginUser() {
        return sysLoginuserLocal.get();
    }

    public static void setSysLoginUser(SysLoginUser loginUser) {
        sysLoginuserLocal.set(loginUser);
    }

    public static void removeSysLoginUser(){
        sysLoginuserLocal.remove();
    }


    public static AppLoginUser getAppLoginUser() {
        return appLoginUserLocal.get();
    }

    public static void setAppLoginUser(AppLoginUser loginUser) {
        appLoginUserLocal.set(loginUser);
    }

    public static void removeAppLoginUser(){
        appLoginUserLocal.remove();
    }

}

